<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: LIN          (Local Interconnect Network)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__lin.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">LIN (Local Interconnect Network)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The LIN driver provides a function API to manage Local Interconnect Network. </p>
<p>The functions and other declarations used in this driver are in cy_lin.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.</p>
<p>The Local Interconnect Network (LIN) bus was developed to create a standard for low-cost, low-end multiplexed communication. The use of a standard bus protocol promotes the interoperability of network nodes. The LIN bus is a sub-bus system based on a serial communications protocol. The bus is a single master / multiple slave bus that uses a single wire to transmit data. A LIN cluster exchanges messages with a pre-defined message frame format. The master node initiates a message exchange. Both the master node and the slave nodes can transmit (TX) and receive (RX). The LIN protocol is half-duplex: a LIN node is either transmitting or receiving, but it cannot transmit and receive at the same time. Messages are exchanged when the LIN cluster is in operational mode. A LIN cluster also exchanges wake-up signals. Both the master node and the slave nodes can initiate a wake-up. Wake-up signals are exchanged when the LIN cluster is in sleep mode. The LIN bus can have a length of 10's of meters and has a bit-rate in the range of 1 kbps to 20 kbps. Most bus timing is expressed in bit periods (e.g. a 20 kbps LIN bus has a 50 us bit period). The LIN bus uses single wire communication using a "lin" line with an operating Voltage of 12 V. Most master and slave nodes use discrete transceiver devices.</p>
<p>Features:</p><ul>
<li>Single LIN hardware unit supporting multiple LIN channels.</li>
<li>Unified interrupt model.</li>
</ul>
<p>Per LIN channel:</p><ul>
<li>Master and slave functionality.</li>
<li>Master node autonomous header transmission.</li>
<li>Master node autonomous response transmission and reception.</li>
<li>Slave node autonomous header reception.</li>
<li>Slave node autonomous response transmission and reception.</li>
<li>Message buffer for PID, data, and checksum fields.</li>
<li>Break detection during message reception.</li>
<li>Classic and enhanced checksum.</li>
<li>Wakeup signaling.</li>
<li>Timeout detection.</li>
<li>Error detection.</li>
</ul>
<p>The LIN bus is an industry standard.</p>
<div class="image">
<img src="lin_network.png" alt="lin_network.png" width="400px"/>
<div class="caption">
LIN Network</div></div>
 <p>Message Format:</p>
<p>A LIN message have a pre-defined message frame format.</p>
<p>A frame consists of a header, followed by a response. A frame header consists of a break field, followed by a synchronization field, followed by a protected identifier (PID) field. A frame response consists of 1, 2, ..., or 8 data fields, followed by a checksum field. The PID field, data fields and checksum fields are supported through a message buffer registers (MMIO PID_CHECKSUM, DATA0 and DATA1 registers).</p>
<p>When transmitting, the message buffer registers provides the "to be transmitted" field values (with the exception of the checksum field, which is dynamically calculated). When receiving, the message buffer registers capture the received field values.</p>
<div class="image">
<img src="LIN_Message_Format.png" alt="LIN_Message_Format.png" width="600px"/>
<div class="caption">
LIN Message Format</div></div>
 <p>The break field length and the break delimiter length.</p>
<p>All other fields are 8-bit (1Byte) values that are transferred in a "UART format" with 1 START bit period and 1 STOP bit period.</p>
<p>When receiving, the START and STOP bits are verified. In case of verification failure, a RX_HEADER_FRAME_ERROR or RX_RESPONSE_FRAME_ERROR is activated. Byte values are transmitted with least significant bit first format.</p>
<p>Initialization:</p>
<p>The LIN initialization is according to the Options setup in the passed Config Struct. <a class="el" href="structcy__stc__lin__config__t.html">cy_stc_lin_config_t</a> Several validations are done before that and an error is returned if invalid Modes are requested.</p>
<p>Lin Configuration:</p>
<p>Break_Wakup_Length field is used for transmission/reception of BOTH break and wakeup signals. </p><dl class="section note"><dt>Note</dt><dd>These functions are mutually exclusive: Break_Delimiter_length field specifies the break delimiter length: used in header transmission, not used in header reception. STOP bit periods: LIN mode.</dd></dl>
<div class="fragment"><div class="line"></div><div class="line"><span class="preprocessor">#define LIN_MASTER_CHANNEL LIN0_CH0</span></div><div class="line"><span class="preprocessor">#define LIN_SLAVE_CHANNEL LIN0_CH1</span></div><div class="line"></div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__lin__config__t.html">cy_stc_lin_config_t</a> lin_0_ch0_config =</div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__lin__config__t.html#aaf42f95b7833fbe9e9af9d3ba3791997">masterMode</a> = <span class="keyword">true</span>,</div><div class="line">        .linTransceiverAutoEnable = <span class="keyword">true</span>,</div><div class="line">        .breakFieldLength = 13,</div><div class="line">        .breakDelimiterLength = <a class="code" href="group__group__lin__enums.html#ggac081822aba019eda4d5a6434d775eca6a75c98bef0e054b5c77e6f90929df5736">LIN_BREAK_DILIMITER_LENGTH_4BITS</a>,</div><div class="line">        .stopBit = <a class="code" href="group__group__lin__enums.html#gga94412ac1e6b2f694e669917f366d32e5ad09cc58eb444d63fc6bf71df4b058851">LIN_ONE_STOP_BIT</a>,</div><div class="line">        .filterEnable = <span class="keyword">true</span>,</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != <a class="code" href="group__group__lin__functions.html#ga022f651949b9b0da42eb49b26d6dc629">Cy_LIN_Init</a>(LIN0_CH0, &amp;lin_0_ch0_config))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div></div><!-- fragment --><p> Command:</p>
<p>There are 5 commands that user can set in combinations. to send the data.</p><ul>
<li>TX_HEADER</li>
<li>RX_HEADER</li>
<li>TX_RESPONSE</li>
<li>RX_RESPONSE</li>
<li>TX_WAKEUP</li>
</ul>
<p>The following restrictions apply when programming the commands:</p><ul>
<li>TX_HEADER and RX_HEADER are mutually exclusive; i.e. both cannot be set to '1'.</li>
<li>TX_WAKEUP is mutually exclusive with all other commands.</li>
<li>TX_RESPONSE and RX_RESPONSE are NOT mutually exclusive, but are evaluated in the following order (of decreasing priority): TX_RESPONSE, RX_RESPONSE.</li>
</ul>
<p>The break or wakeup detection is always enabled, regardless of CMD register setting.</p>
<p>Following are the combination of commands that user can use. These commands can be provided as predefined commands in cy_lin.h.</p><ul>
<li>LIN_CMD_TX_HEADER</li>
<li>LIN_CMD_TX_RESPONSE</li>
<li>LIN_CMD_RX_RESPONSE</li>
<li>LIN_CMD_TX_HEADER_TX_RESPONSE</li>
<li>LIN_CMD_TX_HEADER_RX_RESPONSE</li>
<li>LIN_CMD_RX_HEADER_RX_RESPONSE</li>
<li>LIN_CMD_TX_WAKEUP</li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/* LIN reception callback */</span></div><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment"> * Master setCmd function</span></div><div class="line"><span class="comment"> * Sets the interrupt mask for desired interrupt callback notification.</span></div><div class="line"><span class="comment"> * Sets the command based on the type of command to be sent.</span></div><div class="line"><span class="comment"> * Master always sends the header.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="keywordtype">void</span> lin_master_setCmd(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    <a class="code" href="group__group__lin__enums.html#ga516d7c6160634505fdfaea4fa051ef13">cy_en_lin_status_t</a> linStatus;</div><div class="line">    <span class="comment">/* LIN operation */</span></div><div class="line">    linStatus = <a class="code" href="group__group__lin__functions.html#ga545104ebfe2a6d54cc7c35cbcc5a46b3">Cy_LIN_SetInterruptMask</a>(LIN_MASTER_CHANNEL, <a class="code" href="group__group__lin__intr__mask__macro.html#ga2b88edb63faec852fd11d5c0ab2f0bc6">LIN_INTR_TX_HEADER_DONE</a> | <a class="code" href="group__group__lin__intr__mask__macro.html#ga339147474b68294af1442f5af6bd71f2">LIN_INTR_TX_RESPONSE_DONE</a> | <a class="code" href="group__group__lin__intr__mask__macro.html#gae9a56849db1e242346561c36fd8d7e71">LIN_INTR_RX_RESPONSE_DONE</a> | <a class="code" href="group__group__lin__intr__mask__macro.html#ga4647cf9bc2f8e5f3a0a7a0cab1d06757">LIN_INTR_ALL_ERROR_MASK_SLAVE</a>);</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">    {</div><div class="line">          <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line">    linStatus = <a class="code" href="group__group__lin__functions.html#ga5b3de77896f20af2c86306dce5434d44">Cy_LIN_SetChecksumType</a>(LIN_MASTER_CHANNEL,<a class="code" href="group__group__lin__enums.html#ggab813994a03707cbee68cfa5894d82800a5057883612e5853e964c48c513e2aeaf">LIN_CHECKSUM_TYPE_EXTENDED</a>);</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">    {</div><div class="line">          <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line">    linStatus = <a class="code" href="group__group__lin__functions.html#gaeeb11daf2fc23f165651c5b81b7c82c4">Cy_LIN_SetHeader</a>(LIN_MASTER_CHANNEL, master_msgContext[scheduleIdx].<span class="keywordtype">id</span>);</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">    {</div><div class="line">         <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line">    linStatus = <a class="code" href="group__group__lin__functions.html#ga82271648198d79ec6b6b04d121760e47">Cy_LIN_SetDataLength</a>(LIN_MASTER_CHANNEL, <a class="code" href="group__group__lin__common__macro.html#ga5c2f843627af7f46df3294789769b490">LIN_DATA_LENGTH_MAX</a>);</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">    {</div><div class="line">         <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>((master_msgContext[scheduleIdx].<span class="keywordtype">id</span> == 0x02) || (master_msgContext[scheduleIdx].<span class="keywordtype">id</span> == 0x11))</div><div class="line">    {</div><div class="line">        linStatus = <a class="code" href="group__group__lin__functions.html#gadc187085698922054358f40f61102766">Cy_LIN_WriteData</a>(LIN_MASTER_CHANNEL, srcData, <a class="code" href="group__group__lin__common__macro.html#ga5c2f843627af7f46df3294789769b490">LIN_DATA_LENGTH_MAX</a>);</div><div class="line">        <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">        {</div><div class="line">             <span class="comment">/* Insert error handling */</span></div><div class="line">        }</div><div class="line"></div><div class="line">        linStatus = <a class="code" href="group__group__lin__functions.html#ga03c597f64053b7ebe11db0d332f21af2">Cy_LIN_SetCmd</a>(LIN_MASTER_CHANNEL, <a class="code" href="group__group__lin__cmd__macro.html#gaa420884eb883917d6414676767904553">LIN_CMD_TX_HEADER_TX_RESPONSE</a>);</div><div class="line">        <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">        {</div><div class="line">             <span class="comment">/* Insert error handling */</span></div><div class="line">        }</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        linStatus = <a class="code" href="group__group__lin__functions.html#ga03c597f64053b7ebe11db0d332f21af2">Cy_LIN_SetCmd</a>(LIN_MASTER_CHANNEL, <a class="code" href="group__group__lin__cmd__macro.html#ga2b16a62d26bff9be6776888b486ab469">LIN_CMD_TX_HEADER_RX_RESPONSE</a>);</div><div class="line">        <span class="keywordflow">if</span>(<a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a> != linStatus)</div><div class="line">        {</div><div class="line">             <span class="comment">/* Insert error handling */</span></div><div class="line">        }</div><div class="line">    }</div><div class="line"></div><div class="line">}</div></div><!-- fragment --><p> Interrupt Handling :</p>
<p>Lin channels have dedicated interrupts</p>
<p>Driver does not handle interrupts and it is user's responsibility to clear interrupts. User registers for the list of interrupts given below and handle the interrupts in the interrupt handler. A code snippet is given below for registering to the interrupts and handling the interrupts in interrupt handler.</p>
<p>There are 16 type of interrupts that the software can register for</p>
<ul>
<li>TX_HEADER_DONE : When a frame header (break field, synchronization field and PID field) is transmitted.</li>
<li>TX_RESPONSE_DONE : When a frame response (data fields and checksum field) is transmitted.</li>
<li>TX_WAKEUP_DONE : When a wakeup signal is transmitted. This cause is activated on a transition from dominant/'0' state to recessive/'1' state; i.e. at the end of the wakeup signal.</li>
<li>RX_HEADER_DONE : When a frame header (break field, synchronization field and PID field) is received.</li>
<li>RX_RESPONSE_DONE : When a frame response (data fields and checksum field) is received</li>
<li>RX_BREAK_WAKEUP_DONE : When a break or wakeup signal is received (per CTL.BREAK_WAKEUP_LENGTH). This cause is activated on a transition from dominant/'0' state to recessive/'1' state; i.e. at the end of the wakeup signal.</li>
<li>RX_HEADER_SYNC_DONE : When a synchronization field is received (including trailing STOP bits).</li>
<li>RX_NOISE_DETECT : When isolated '0' or '1' "in_rx_in" values are observed or when during sampling the last three "lin_rx_in" values do NOT all have the same value. This mismatch is an indication of noise on the LIN line.</li>
<li>TIMEOUT : When a frame, frame header or frame response timeout is detected.</li>
<li>TX_HEADER_BIT_ERROR : When a transmitted "lin_tx_out" value does NOT match a received "lin_rx_in" value (during header transmission). This specific test allows for delay through the external transceiver. This mismatch is an indication of bus collisions on the LIN line.</li>
<li>TX_RESPONSE_BIT_ERROR : When a transmitted "lin_tx_out" value does NOT match a received "lin_rx_in" value (during response transmission).</li>
<li>RX_HEADER_FRAME_ERROR : When the received START or STOP bits have an unexpected value (during header reception).</li>
<li>RX_HEADER_SYNC_ERROR : When the received synchronization field is not received within the synchronization counter range [106, 152]</li>
<li>RX_HEADER_PARITY_ERROR : When the received PID field has a parity error.</li>
<li>RX_RESPONSE_FRAME_ERROR : When the received START or STOP bits have an unexpected value (during response reception)</li>
<li>RX_RESPONSE_CHECKSUM_ERROR : When the calculated checksum over the received PID and data fields is not the same as the received checksum.</li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/* LIN interrupt handler */</span></div><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment"> * Master Interrupt handler</span></div><div class="line"><span class="comment"> * Master Sends the header and wait for interrupts.</span></div><div class="line"><span class="comment"> * If the Interrupt is for Tx Header Done then Header is transferred properly.</span></div><div class="line"><span class="comment"> * If the interrupt is for Rx Response Done then Master reads the response.</span></div><div class="line"><span class="comment"> * If the Interrupt is for Tx Response Done then response is transferred properly.</span></div><div class="line"><span class="comment"> * Handle any Errors if there is an error interrupt.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="keywordtype">void</span> lin_master_intHandler(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    uint32_t status;</div><div class="line">    uint32_t maskStatus;</div><div class="line">    <a class="code" href="group__group__lin__enums.html#ga516d7c6160634505fdfaea4fa051ef13">cy_en_lin_status_t</a> linStatus;</div><div class="line"></div><div class="line">    <a class="code" href="group__group__lin__functions.html#ga621860135fb27c82e6cea7488dad4543">Cy_LIN_GetInterruptMaskedStatus</a>(LIN_MASTER_CHANNEL, &amp;maskStatus);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> ((maskStatus &amp; <a class="code" href="group__group__lin__intr__mask__macro.html#gac6cc43ba7dbe0c5716a9fc2487d6145e">LIN_INTR_ALL_ERROR_MASK_MASTER</a>) != 0u)</div><div class="line">    {</div><div class="line">        <span class="comment">/* There are some error */</span></div><div class="line">        <span class="comment">/* Handle error if needed. */</span></div><div class="line"></div><div class="line">        <span class="comment">/* Disable the channel to reset LIN status */</span></div><div class="line">        <a class="code" href="group__group__lin__functions.html#ga7f0d57ec29739409641ab31d55027f24">Cy_LIN_Disable</a>(LIN_MASTER_CHANNEL);</div><div class="line">        <span class="comment">/* Re-enable the channel */</span></div><div class="line">        <a class="code" href="group__group__lin__functions.html#gaeaf5d7ed1dad6387c6e29ae9e1e6f283">Cy_LIN_Enable</a>(LIN_MASTER_CHANNEL);</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        <span class="keywordflow">if</span>(maskStatus &amp; <a class="code" href="group__group__lin__intr__mask__macro.html#ga2b88edb63faec852fd11d5c0ab2f0bc6">LIN_INTR_TX_HEADER_DONE</a>)</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__lin__functions.html#ga09ae5f9ff1edcf886fc2abf09de8e5c2">Cy_LIN_ClearInterrupt</a>(LIN_MASTER_CHANNEL, LIN_INTR_TX_HEADER_DONE);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(maskStatus &amp; <a class="code" href="group__group__lin__intr__mask__macro.html#ga339147474b68294af1442f5af6bd71f2">LIN_INTR_TX_RESPONSE_DONE</a>)</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__lin__functions.html#ga09ae5f9ff1edcf886fc2abf09de8e5c2">Cy_LIN_ClearInterrupt</a>(LIN_MASTER_CHANNEL, maskStatus);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(maskStatus &amp; <a class="code" href="group__group__lin__intr__mask__macro.html#gae9a56849db1e242346561c36fd8d7e71">LIN_INTR_RX_RESPONSE_DONE</a>)</div><div class="line">        {</div><div class="line">            memset(dstData, 0, <a class="code" href="group__group__lin__common__macro.html#ga5c2f843627af7f46df3294789769b490">LIN_DATA_LENGTH_MAX</a>*<span class="keyword">sizeof</span>(dstData[0]));</div><div class="line">            linStatus = <a class="code" href="group__group__lin__functions.html#gafc5157ee9701212ec438b8935e025008">Cy_LIN_ReadData</a>(LIN_MASTER_CHANNEL, dstData);</div><div class="line">            <span class="keywordflow">if</span>(linStatus != <a class="code" href="group__group__lin__enums.html#gga516d7c6160634505fdfaea4fa051ef13a0e9cd7048d6006eddbfcd52a87285cae">CY_LIN_SUCCESS</a>)</div><div class="line">            {</div><div class="line">                <span class="comment">/* Insert error handling */</span></div><div class="line">            }</div><div class="line">            <span class="keywordflow">else</span></div><div class="line">            {</div><div class="line">                status = memcmp(srcData, dstData, (<a class="code" href="group__group__lin__common__macro.html#ga5c2f843627af7f46df3294789769b490">LIN_DATA_LENGTH_MAX</a>*<span class="keyword">sizeof</span>(dstData[0])));</div><div class="line">                <span class="keywordflow">if</span> (status !=0)</div><div class="line">                {</div><div class="line">                    <span class="comment">/* Insert error handling */</span></div><div class="line">                }</div><div class="line">            }</div><div class="line">            <a class="code" href="group__group__lin__functions.html#ga09ae5f9ff1edcf886fc2abf09de8e5c2">Cy_LIN_ClearInterrupt</a>(LIN_MASTER_CHANNEL, maskStatus);    <span class="comment">/* Clear all accepted interrupt. */</span></div><div class="line">        }</div><div class="line">    }</div><div class="line">}</div></div><!-- fragment --> <h1><a class="anchor" id="group_lin_changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td rowspan="3">1.2 </td><td>Sets LIN break/wakeup field length updated in the <a class="el" href="group__group__lin__functions.html#gad350aa9efb6456b15bd19496c8a2fbd3">Cy_LIN_SetBreakWakeupFieldLength</a> function </td><td>Bug fix  </td></tr>
<tr>
<td>Sets LIN response field data length updated in the <a class="el" href="group__group__lin__functions.html#ga82271648198d79ec6b6b04d121760e47">Cy_LIN_SetDataLength</a> function </td><td>Bug fix  </td></tr>
<tr>
<td>Sets LIN checksum type setting updated in the <a class="el" href="group__group__lin__functions.html#ga5b3de77896f20af2c86306dce5434d44">Cy_LIN_SetChecksumType</a> function </td><td>Bug fix  </td></tr>
<tr>
<td>1.1 </td><td>Fixed MISRA 2012 violations. </td><td>MISRA 2012 compliance.  </td></tr>
<tr>
<td>1.0 </td><td>Initial version </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__lin__macro"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__lin__macro.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__lin__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__lin__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__lin__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__lin__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__lin__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__lin__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
